package com.zhiqihang.order;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by admin on 2018/2/10.
 */
@Data
@Entity(name = "ziqihang_order")
public class Orders implements Serializable {
    private static final long serialVersionUID = -916357210051689789L;

    //订单编号
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "订单编号")
    @Column(name="out_trade_no")
    private Long outTradeNo;
    @ApiModelProperty(value = "订单标题")
    @Column(name="subject")
    private String subject;
    @ApiModelProperty(value = "最初价格")
    @Column(name="initial_price")
    private String initialPrice;
    @ApiModelProperty(value = "交易价格")
    @Column(name="total_amount")
    private Double totalAmount;
    @ApiModelProperty(value = "订单创建时间")
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    @Column(name="create_time")
    private Date createTime;
    @ApiModelProperty(value = "支付方式")
    @Column(name="payment")
    private String payment;
    @ApiModelProperty(value = "支付时间")
    @Column(name="pay_time")
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private Date payTime;
    @ApiModelProperty(value = "交易流水号")
    @Column(name="trade_no")
    private String tradeNo;
    @ApiModelProperty(value = "收款方")
    @Column(name="payee")
    private String payee;
    @ApiModelProperty(value = "交易状态，0待支付 1支付成功 2撤回")
    @Column(name="status")
    private String status;
    @ApiModelProperty(value = "用户id")
    @Column(name="user_id")
    private String userId;
    @ApiModelProperty(value = "课程id")
    @Column(name="course_id")
    private Integer courseId;

}
